package hamster.csustef.acquisition.api;

import hamster.csustef.acquisition.constant.AcquisitionConstant;
import hamster.csustef.acquisition.util.PythonUtil;

import java.util.ArrayList;

public class WeatherApi {

    public static boolean getWeather(String servers, String topic, String message) {
        ArrayList<String> list = new ArrayList<>();
        list.add(servers);
        list.add(topic);
        list.add(message);
        return PythonUtil.executePython("/root/IdeaProjects/csust_electric_fee_dw/weather_crawler/weather_crawler.py", list) == 0;
    }

    public static void main(String[] args) {
        System.out.println(WeatherApi.getWeather(AcquisitionConstant.KAFKA_SERVERS, AcquisitionConstant.CS_WEATHER_TOPIC, "CLOSE"));
    }
}
